<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAuthorityTable extends Migration
{
    /**
     * @author mais <[<380354618#qq.com>]>
     * 权限表 authority
     * @return void
     */
    public function up()
    {
        Schema::create('authority', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('uid');
            $table->tinyinteger('goods_auth')->comment('商品管理权限,0无权,1查,2增查改');
            $table->tinyinteger('user_auth')->comment('用户管理权限,0无权,1查,2增查改');
            $table->tinyinteger('admin_auth')->comment('后台管理权限,0无权,1查,2增查改');
            $table->tinyinteger('state');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('authority');
    }
}
